#include "cpuwidget.h"
#include <QApplication>
#include <stdio.h>
#include <cpuid.h>
#ifdef __cplusplus

extern "C" {
#endif
#include <example_dll.h>
//#include <cpuinfo.h>
#ifdef __cplusplus
}
#endif

int main(int argc, char *argv[])
{
//    int eax, ebx, ecx, edx;
//    eax = ebx = ecx = edx = 0;

//    char cpu_brand[49] = {0};
//    //__cpuid(0x80000002, eax, ebx, ecx, edx);
//    eax = cpu_id(0x80000002, &ebx, &ecx, &edx);
//    memcpy((char*)cpu_brand, (char*)&eax, 4);
//    memcpy((char*)(cpu_brand+4), (char*)&ebx, 4);
//    memcpy((char*)(cpu_brand+8), (char*)&ecx, 4);
//    memcpy((char*)(cpu_brand+12), (char*)&edx, 4);
//    //__cpuid(0x80000003, eax, ebx, ecx, edx);
//    eax = cpu_id(0x80000003, &ebx, &ecx, &edx);
//    memcpy(cpu_brand+16, (char*)&eax, 4);
//    memcpy(cpu_brand+20, (char*)&ebx, 4);
//    memcpy(cpu_brand+24, (char*)&ecx, 4);
//    memcpy(cpu_brand+28, (char*)&edx, 4);
//    //__cpuid(0x80000004, eax, ebx, ecx, edx);
//    eax = cpu_id(0x80000004, &ebx, &ecx, &edx);
//    memcpy(cpu_brand+32, (char*)&eax, 4);
//    memcpy(cpu_brand+36, (char*)&ebx, 4);
//    memcpy(cpu_brand+40, (char*)&ecx, 4);
//    memcpy(cpu_brand+44, (char*)&edx, 4);
//    puts(cpu_brand);

    int c = example_add(10, 20);
    print(c);

    QApplication a(argc, argv);

    CpuWidget w;
    w.show();

    return a.exec();
}
